# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=ansible-lint
pkgver=6.3.0
pkgrel=1
pkgdesc="check ansible playbooks"
url="https://github.com/ansible/ansible-lint"
arch="noarch"
options="!check"
license="MIT"
depends="
	python3
	ansible-core
	py3-enrich
	py3-packaging
	py3-rich
	py3-ruamel.yaml
	py3-tenacity
	py3-tomli
	py3-typing-extensions
	py3-wcmatch
	py3-yaml
	py3-ansible-compat
	py3-jsonschema
	yamllint
	"
makedepends="
	py3-build
	py3-installer
	py3-setuptools
	py3-wheel
	py3-setuptools_scm
	"
checkdepends="
	py3-flaky
	py3-psutil
	py3-pytest
	py3-pytest-cov
	py3-pytest-xdist
	yamllint
	"
source="ansible-lint-$pkgver.tar.gz::https://github.com/ansible-community/ansible-lint/archive/refs/tags/v$pkgver/ansible-lint-v$pkgver.tar.gz"
provides="py3-ansible-lint=$pkgver-r$pkgrel" # for backward compatibility
replaces="py3-ansible-lint" # for backward compatibility

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	python3 -m build --skip-dependency-check --no-isolation --wheel
}

check() {
	pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/ansible_lint-$pkgver-py3-none-any.whl
}

sha512sums="
3e9d480cb90f3022a4b001c061c3e76b753620776a009b1563dce335c13ee38b7ac334725592ac644a2808d85ceb98b618a451c193bc7c4961474d4e7fbbb88e  ansible-lint-6.3.0.tar.gz
"
